<!-- 协议富文本承载 -->
<template>
  <view class="mx-40rpx py-10rpx">
    <rich-text class="lh-1.5rem" :nodes="state.content"></rich-text>
  </view>
</template>

<route lang="json">{
  "style": {
    "navigationStyle": "default",
    "navigationBarTitleText": "协议"
  }
}</route>

<script lang="ts" setup>
import { getAgreementRq } from '@/api'

const state = reactive({
  type: '1',
  content: '',
})

onLoad((options) => {
  if (options?.type) {
    state.type = options?.type
  }
  getAgreementRq(state.type).then((r) => {
    if (r.data?.code === 200) {
      state.content = r.data.data.content
    }
  }).catch(err => {
    console.error('获取协议失败', err)
  })
})

</script>


<style lang="scss" scoped>
.ql-align-center {
  text-align: center;
  margin: 20rpx;
}
</style>
